package com.example.project1.activity;

import org.xutils.x;
import org.xutils.view.annotation.ContentView;
import org.xutils.view.annotation.ViewInject;

import android.os.Bundle;
import android.support.v4.app.FragmentTransaction;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.FrameLayout;
import android.widget.LinearLayout;

import com.example.project1.R;
import com.example.project1.fragment.HuJiao_wuliao_Fragment;
@ContentView(value=R.layout.activity_hujiao)
public class HuJiaoActivity extends BaseActivity {
@ViewInject(value=R.id.ll_fragment_wuliao)
private FrameLayout frame;
@ViewInject(value=R.id.ll_hujiao)
private LinearLayout line;

@ViewInject(value=R.id.btn_ysj_hujiao)
private Button btn_ysj;
@ViewInject(value=R.id.btn_yp_hujiao)
private Button btn_yp;

private HuJiao_wuliao_Fragment hujiaoFrag;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		x.view().inject(this);
		setListener();
	}
	private void setListener() {
		btn_ysj.setOnClickListener(new BtnListener());
		btn_yp.setOnClickListener(new BtnListener());
	}

	class BtnListener implements OnClickListener{

		@Override
		public void onClick(View v) {
			switch(v.getId()){
			case R.id.btn_ysj_hujiao:
				showWuLiaoFragment();
				break;
			case R.id.btn_yp_hujiao:
				break;
			case R.id.btn_yp2_hujiao:
				break;
			}
		}
		
	}
	private void showWuLiaoFragment(){
		line.setVisibility(View.INVISIBLE);
		FragmentTransaction transaction=getSupportFragmentManager().beginTransaction();
		hujiaoFrag=new HuJiao_wuliao_Fragment();
		transaction.replace(R.id.ll_fragment_wuliao , hujiaoFrag);
		transaction.show(hujiaoFrag);
		transaction.commit();
	}
}
